# Author:: Alexandre Ribeiro de Souza (<alexandre@lumis.com.br>)

include Opscode::Aws::Ec2

action :create do
  ec2.create_tags(instance_id, {new_resource.tag => new_resource.value})
  new_resource.updated_by_last_action(true)
  Chef::Log.info("Added tag #{new_resource.tag} with value #{new_resource.value}")
end

action :delete do
  ec2.delete_tags(instance_id, new_resource.tag)
  new_resource.updated_by_last_action(true)
  Chef::Log.info("Deleted tag #{new_resource.tag}")
end